# -*- coding: utf-8 -*-

import argparse
import sys


def parse_args():
    parser = argparse.ArgumentParser(description="OS Performance Monitor")
    parser.add_argument('--cli', action='store_true', help='Run in command-line mode')
    return parser.parse_args()


if __name__ == "__main__":
    args = parse_args()
    if args.cli:
        from centos.menu import run_cli_mode

        run_cli_mode()  # 待实现的 CLI 模式
    else:
        from PyQt6.QtWidgets import QApplication
        from window.main_window.main_window import MainWindow
        from qfluentwidgets import FluentTranslator

        app = QApplication(sys.argv)

        # 安装翻译
        translator = FluentTranslator()
        app.installTranslator(translator)

        window = MainWindow()
        # 设置显示位置，居中显示
        window.move(app.primaryScreen().availableGeometry().center() - window.rect().center())
        window.show()

        sys.exit(app.exec())
